"""
@Version: V1.0
@Author: wilson
@License: Apache Licence
@Contact: wevsmy@qq.com
@Site: http://wevsmy.cn
@Software: PyCharm
@File: getHtmlText.py
@Time: 5/11 0:33
"""


def getHTMLText(url):
    import requests
    try:
        data = requests.get(url, timeout=30)
        data.raise_for_status()
        data.encoding = data.apparent_encoding
        return data.text
    except:
        return "getHTMLText Error"


class Main():
    def __init__(self):
        pass


if __name__ == '__main__':
    url = "http:/www.baidu.com"
    url = "https://www.bilibili.com/activity/web/view/data/31"
    print(getHTMLText(url))
    pass